<?php

require(dirname(__FILE__) . "/../classes/common.inc.php");
require("PHPUnit/Framework.php");

class LolEnglishTest extends PHPUnit_Framework_TestCase {
	
	public function testSimpleSentences() {
		$t = new Translator("lol-english");
		$this->assertEquals("I IZ IN MAH BED!", $t->translate("I IS IN MY BED!"));
		$this->assertEquals("I IZ IN MAH BED!", $t->translate("I AM IN MY BED!"));
		$this->assertEquals("OH NOES!", $t->translate("Oh no!"));
		$this->assertEquals("I HAS A FLAVUR", $t->translate("i have a flavour"));
		$this->assertEquals("OH NOES! THEY BE STEALIN MAH BUKKIT", $t->translate("oh no! they are stealing my bucket"));
		$this->assertEquals("I HAS A BUKKIT", $t->translate("i have a bucket"));
	}
	
	public function testSuffixes() {
		$t = new Translator("lol-english");
		$this->assertEquals("CELEBRASHUN", $t->translate("celebration"));
		$this->assertEquals("CELEBRASHUNZ", $t->translate("celebrations"));
		$this->assertEquals("BUKKIT", $t->translate("bucket"));
		$this->assertEquals("BUKKITZ", $t->translate("buckets"));
		$this->assertEquals("CHRISCHUNZ", $t->translate("christians"));
	}
	
	public function testWordFragments() {
		$t = new Translator("lol-english");
	}
	
	public function testWordSubstitution() {
		$t = new Translator("lol-english");
		$this->assertEquals("I IZ", $t->translate("i am"));
		$this->assertEquals("MAH", $t->translate("my"));
		$this->assertEquals("WIF", $t->translate("with"));
		$this->assertEquals("NEW", $t->translate("new"));
	}
	
	public function testExistingSentences() {
		$t = new Translator("lol-english");
		$this->assertEquals("BABEE I LUFF U", $t->translate("baby i love you"));
		$this->assertEquals("BUT I EATED IT", $t->translate('but i ate it'));
		$this->assertEquals("HAPPEE BERFDAI", $t->translate('happy birthday'));
	}
	
}